package com.sz.biz.logistics.core.dto;

import com.sz.biz.logistics.core.entity.PriceComboQuotation;
import com.sz.common.base.entity.EntityBase;
import com.sz.common.base.utils.EntityUtils;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * Function: 价格套餐与报价表中间表Dto <br>
 * Author: hpeng.wang <br>
 * Date: 2017-04-18 16:37:00
 */
public class PriceComboQuotationDto extends EntityBase {

    public PriceComboQuotationDto(PriceComboQuotation comboQuotation) {
        EntityUtils.copyPropertiesIgnoreNull(comboQuotation, this);
    }

    public PriceComboQuotationDto() {
    }

    /**
     * 自增长id
     */
    private Integer id;

    /**
     * 价格套餐（biz_price_combo）id
     */
    private Integer comboId;
    /**
     * 产品（biz_product）uid
     */
    @NotBlank(message = "validate.notnull")
    private String productUid;
    private String productCode;
    /**
     * 产品名字
     */
    private String productName;

    /**
     * 价格套餐的等级，（biz_price_quotation）grade
     */
    @NotNull(message = "validate.notnull")
    private Integer priceQuotationGrade;
    private String priceQuotationGradeName;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getComboId() {
        return comboId;
    }

    public void setComboId(Integer comboId) {
        this.comboId = comboId;
    }

    public String getProductUid() {
        return productUid;
    }

    public void setProductUid(String productUid) {
        this.productUid = productUid;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Integer getPriceQuotationGrade() {
        return priceQuotationGrade;
    }

    public void setPriceQuotationGrade(Integer priceQuotationGrade) {
        this.priceQuotationGrade = priceQuotationGrade;
    }

    public String getPriceQuotationGradeName() {
        return priceQuotationGradeName;
    }

    public void setPriceQuotationGradeName(String priceQuotationGradeName) {
        this.priceQuotationGradeName = priceQuotationGradeName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        PriceComboQuotationDto that = (PriceComboQuotationDto) o;

        if (productUid != null ? !productUid.equals(that.productUid) : that.productUid != null) {
            return false;
        }
        return priceQuotationGrade != null ? priceQuotationGrade.equals(that.priceQuotationGrade) : that.priceQuotationGrade == null;

    }

    @Override
    public int hashCode() {
        int result = productUid != null ? productUid.hashCode() : 0;
        result = 31 * result + (priceQuotationGrade != null ? priceQuotationGrade.hashCode() : 0);
        return result;
    }
}